<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>changePassengerMessAudit.html</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<style>
		body{
			background:#f1f1f1;
		}
		#box{
			margin-left:14px;			
		}
		.title{
			height:45px;
			line-height:45px;
			margin-left:4px;
			font-size:14px;
			font-weight:900;
			width:1032px;
		}
		.quare{
			margin:0 7px 0 0;
			position:relative;
			top:3px;
			display:inline-block;
			width:4px;
			height:16px;
			background:#00aa98;
		}
		.tableDiv{
			width:1000px;
			padding:20px;
			background:white;
		}
		table{
			width:1000px;
		}
		th{
			background:#f0eeef;
			width:100px;
		}
		td{
			background:white;			
		}
		td,th{
			border:1px solid #e6e6e6;
			height:34px;
		}
		.audit{
			width:1020px;
			background:white;
			height:220px;
			padding:20px 0 0 20px;
		}
		input[type=radio]{
			position:relative;
			top:4px;
			left:-3px;
		}
		.audit>p{
			margin-top:10px;
		}
		.audit label{
			margin-right:5px;
		}
		input[type=text],textarea{
			border:1px solid #e2e2e4;
		}
		input[type=text]{
			width:200px;
			height:23px;
		}
		textarea{
			width:1000px;
			height:100px;		
			margin-top:5px;	
		}
		.btnBox button{
			width:90px;
			height:28px;
			background:#00aa98;
			cursor:pointer;
			border:none;
			border-radius:2px;
			color:white;
			margin-top:20px;
		}
		.btnBox  .cancel{
			margin-left:20px;
			background:#acacac;
		}
	</style>
	<body ng-app="myApp" ng-controller="ctrl1">	
		<div id="box">
			<p class="title"><span class="quare"></span>修改前</p>
			<div class="tableDiv">
				<table>
					<tr>
						<th>旅客姓名</th>
						<th>出生日期</th>
						<th>性别</th>
						<th>国籍</th>
						<th>证件类型</th>
						<th>证件号</th>
						<th>证件有效期</th>
						<th>发证国</th>
						<th>电话</th>
						<th>酒店信息</th>
						<th>邮箱</th>
					</tr>
					<tr>
						<td><span ng-bind="beforeChangeData.chineseSurname+beforeChangeData.chineseName"></span></br><span ng-bind="beforeChangeData.englishSurname+beforeChangeData.englishName"></span></td>
						<td ng-bind="beforeChangeData.birthDate"></td>
						<td ng-bind="beforeChangeData.gender|gender"></td>
						<td ng-bind="beforeChangeData.country"></td>
						<td ng-bind="beforeChangeData.certificateType|certificateType"></td>
						<td ng-bind="beforeChangeData.certificateNumber"></td>
						<td ng-bind="beforeChangeData.certificateExpireDate"></td>
						<td ng-bind="beforeChangeData.issuingCountry"></td>
						<td ng-bind="beforeChangeData.mobile"></td>
						<td ng-bind="beforeChangeData.grogshop"></td>
						<td ng-bind="beforeChangeData.email"></td>
					</tr>
				</table>				
			</div>
			<p class="title"><span class="quare"></span>修改后</p>
			<div class="tableDiv">
				<table>
					<tr>
						<th>旅客姓名</th>
						<th>出生日期</th>
						<th>性别</th>
						<th>国籍</th>
						<th>证件类型</th>
						<th>证件号</th>
						<th>证件有效期</th>
						<th>发证国</th>
						<th>电话</th>
						<th>酒店信息</th>
						<th>邮箱</th>
					</tr>
					<tr>
						<td><span ng-bind="afterChangeData.chineseSurname+afterChangeData.chineseName"></span></br><span ng-bind="afterChangeData.englishSurname+afterChangeData.englishName"></span></td>
						<td ng-bind="afterChangeData.birthDate"></td>
						<td ng-bind="afterChangeData.gender|gender"></td>
						<td ng-bind="afterChangeData.country"></td>
						<td ng-bind="afterChangeData.certificateType|certificateType"></td>
						<td ng-bind="afterChangeData.certificateNumber"></td>
						<td ng-bind="afterChangeData.certificateExpireDate"></td>
						<td ng-bind="afterChangeData.issuingCountry"></td>
						<td ng-bind="afterChangeData.mobile"></td>
						<td ng-bind="afterChangeData.grogshop"></td>
						<td ng-bind="afterChangeData.email"></td>
					</tr>
				</table>				
			</div>
			<p class="title"><span class="quare"></span>审核</p>
			<div class="audit">
				<p>
					<label>改名费用</label>
					<input ng-model="quotePrice" type="text"/>
					<span ng-bind="quoteCurrency"></span>
				</p>
				<p>
					<label>审核结果</label>
					<span><input ng-model="result" type="radio" name="audit" value="true"/>通过</span>
					<span><input ng-model="result" type="radio" name="audit" value="false"/>不通过</span>
				</p>
				<p class="auditRemark">
					<li><label class="remark">审核意见</label><span class="fontababab">(300字以内)</sapn></li>
					<span><textarea ng-model="remark"></textarea></span>
				</p>
			</div>
			<div class="btnBox">
				<button class="sure" ng-click="sure()">确定</button>
				<button class="cancel" ng-click="cancel()">取消</button>
			</div>
		</div>
	</body>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>		
		<script type="text/javascript" src="../js/common.js" ></script>
		<script>
			var myApp = angular.module("myApp",[])
			myApp.controller("ctrl1",function($scope,$http){
				var orderId = getHref().orderId;
				var baojia  = getHref().baojia;				
				var index  = getHref().index;
				$scope.quoteCurrency = baojia||"";
				$scope.quotePrice = "";
				$scope.remark = "";
				$scope.result = "";
				query()
				function query(){
					layer.load();//加载层；
					$http({
						url:"../passenger/m/list?temp="+Math.random(),
						method:'post',
						data:{"orderId":orderId}
					}).success(function(data,header,config,status){
						layer.closeAll("loading");				
						if(data.status=="1001"){						
							$scope.afterChangeData = data.data[index];
							beforeChangeHttp(data.data[index].id);
						}else{
							layer.alert("更改后信息获取失败，"+data.message);
						}
						//响应成功
					}).error(function(data,header,config,status){	
						layer.alert("请求失败，请检查网络连接")
						//处理响应失败
					});
					
				}
				function beforeChangeHttp(id){
					layer.load();//加载层；
					$http({
						url:"../passenger/"+id+"?temp="+Math.random(),
						method:'get',
					}).success(function(data,header,config,status){
						layer.closeAll("loading");				
						if(data.status=="1001"){				
							$scope.beforeChangeData = data.data;								
						}else{
							layer.alert("更改前信息获取失败，"+data.message);
						}
						//响应成功
					}).error(function(data,header,config,status){	
						layer.alert("请求失败，请检查网络连接")
						//处理响应失败
					});
					
				}
				$scope.sure = function(){
					//提交参数
					$scope.postData = {
							pmId:$scope.afterChangeData.id,
							result:$scope.result,
							remark:$scope.remark,
							quoteCurrency:$scope.quoteCurrency,
							quotePrice:$scope.quotePrice							
					}	
					//参数校验
					inputCheckoutFun.price.normal($scope.postData.quotePrice,"改名费用","改名费用为数字,最多保留两位小数!");
					inputCheckoutFun.Empty($scope.result,"审核结果","为必填项");
					inputCheckoutFun.Empty($scope.remark,"审核备注","为必填项");					
					layer.load();//加载层；
					//审核请求
					$http({
						url:"../passenger/m/audit?temp="+Math.random(),
						method:'post',
						data:$scope.postData
					}).success(function(data,header,config,status){
						layer.closeAll("loading");				
						if(data.status=="1001"){	
							layer.msg("审核成功",{icon:1},function(){
								closeWin();
							})													
						}else{
							layer.alert("审核失败，"+data.message);
						}
						//响应成功
					}).error(function(data,header,config,status){	
						layer.alert("请求失败，请检查网络连接")
						//处理响应失败
					});
				}
				$scope.cancel = function(){
					closeWin();
				}
			})
			
			
			
			myApp.filter("gender",function(){
				return function(input){
					if(input=="1"){
						return "男";
					}else if(input=="2"){
						return "女";
					}else {
						return "";
					}
				}
			});
			myApp.filter("certificateType",function(){
				return function(input){
					if(input=="1"){
						return "身份证";
					}else if(input=="2"){
						return "护照";
					}else {
						return "";
					}
				}
			});
		</script>		
</html>
